// 全选/全不选
function checkedAll(obj) {
	var checked = obj.checked;
	var el = document.getElementsByTagName("input");
	for (var i = 0; i < el.length; i ++)
		if (el[i].type == "checkbox" && !el[i].disabled)
			el[i].checked = checked;
}

// 取得被选复选框数量
function getCheckedNum(checkboxName) {
	var num = 0;
	var el = document.getElementsByTagName("input");
	for (var i = 0; i < el.length; i ++)
		if (el[i].type == "checkbox" && el[i].name == checkboxName && !el[i].disabled && el[i].checked)
			num ++;
	return num;
}

// 取得第一个被选复选框的value值
function getCheckboxValue(checkboxName) {
	var el = document.getElementsByTagName("input");
	for (var i = 0; i < el.length; i ++)
		if (el[i].type == "checkbox" && el[i].name == checkboxName && !el[i].disabled && el[i].checked)
			return el[i].value;
}

// 取得所有被选复选框的value值
function getCheckboxValues(checkboxName) {
	var values = new Array();
	var el = document.getElementsByTagName("input");
	for (var i = 0; i < el.length; i ++)
		if (el[i].type == "checkbox" && el[i].name == checkboxName && !el[i].disabled && el[i].checked)
			values.push(el[i].value);
	return values;
}